# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 157
n 157(None)[return None
]:
	i: 109(AL), 156()
	o: 

nname: 156
n 156(None)[]:
	i: 112(AF), 131()
	o: 157()

nname: 131
n 131(None)[for indicator in self.get_list_obj_by_name(self._indicator_name):
indicator.move(hcenter=self.position)
]:
	i: 112(for)
	o: 156()

nname: 112
n 112(None)[]:
	i: 109(loop)
	o: 131(for), 156(AF)

nname: 109
n 109(None)[]:
	i: 0(AL), 108()
	o: 112(loop), 157(AL)

nname: 108
n 108(None)[]:
	i: 64(AF), 83()
	o: 109()

nname: 83
n 83(None)[for bar in self.get_list_obj_by_name(self._bar_name):
bar.resize(width=self.position)
]:
	i: 64(for)
	o: 108()

nname: 64
n 64(None)[]:
	i: 0(loop)
	o: 83(for), 108(AF)

nname: 0
n 0(None)[wyvas.Container.__init__(self)
self._bar_name = None
self._indicator_name = None
self.min = 0
self.max = 100
self.position = 1
]:
	i: 
	o: 64(loop), 109(AL)

nname: 157
n 157(None)[return None
]:
	i: 131()
	o: 

nname: 131
n 131(None)[for indicator in self.get_list_obj_by_name(self._indicator_name):
	indicator.move(hcenter=self.position)
]:
	i: 109(for)
	o: 157()

nname: 109
n 109(None)[]:
	i: 83()
	o: 131(for)

nname: 83
n 83(None)[for bar in self.get_list_obj_by_name(self._bar_name):
	bar.resize(width=self.position)
]:
	i: 0(for)
	o: 109()

nname: 0
n 0(None)[wyvas.Container.__init__(self)
self._bar_name = None
self._indicator_name = None
self.min = 0
self.max = 100
self.position = 1
]:
	i: 
	o: 83(for)

nname: 157
n 157(None)[return None
]:
	i: 109()
	o: 

nname: 109
n 109(None)[for indicator in self.get_list_obj_by_name(self._indicator_name):
	indicator.move(hcenter=self.position)
]:
	i: 0()
	o: 157()

nname: 0
n 0(None)[wyvas.Container.__init__(self)
self._bar_name = None
self._indicator_name = None
self.min = 0
self.max = 100
self.position = 1
for bar in self.get_list_obj_by_name(self._bar_name):
	bar.resize(width=self.position)
]:
	i: 
	o: 109()

nname: 157
n 157(None)[return None
]:
	i: 0()
	o: 

nname: 0
n 0(None)[wyvas.Container.__init__(self)
self._bar_name = None
self._indicator_name = None
self.min = 0
self.max = 100
self.position = 1
for bar in self.get_list_obj_by_name(self._bar_name):
	bar.resize(width=self.position)
for indicator in self.get_list_obj_by_name(self._indicator_name):
	indicator.move(hcenter=self.position)
]:
	i: 
	o: 157()

nname: 0
n 0(None)[wyvas.Container.__init__(self)
self._bar_name = None
self._indicator_name = None
self.min = 0
self.max = 100
self.position = 1
for bar in self.get_list_obj_by_name(self._bar_name):
	bar.resize(width=self.position)
for indicator in self.get_list_obj_by_name(self._indicator_name):
	indicator.move(hcenter=self.position)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb772d0ac>}
nname: 0
n 0(None)[self.set(**value)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb772d2ac>}
nname: 0
n 0(None)[self._bar_name = bar
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb772d38c>}
nname: 0
n 0(None)[self._indicator_name = indicator
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb772d20c>}
nname: 0
n 0(None)[self.position += 1
self._redraw(1)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb772d4ac>}
nname: 76
n 76(None)[self.position = pos
self._redraw(delta)
]:
	i: 40(t), 72()
	o: 

nname: 72
n 72(None)[]:
	i: 40(f)
	o: 76()

nname: 40
n 40(pos)[delta = abs(self.position - pos) / self.max
]:
	i: 26(), 39()
	o: 72(f), 76(t)

nname: 39
n 39(None)[]:
	i: 20(f)
	o: 40()

nname: 26
n 26(None)[self.max = max
]:
	i: 20(t)
	o: 40()

nname: 20
n 20(max)[]:
	i: 6(), 19()
	o: 26(t), 39(f)

nname: 19
n 19(None)[]:
	i: 0(f)
	o: 20()

nname: 6
n 6(None)[self.min = min
]:
	i: 0(t)
	o: 20()

nname: 0
n 0(min)[]:
	i: 
	o: 6(t), 19(f)

nname: 40
n 40(None)[delta = abs(self.position - pos) / self.max
if not pos:
	pass
self.position = pos
self._redraw(delta)
]:
	i: 0()
	o: 

nname: 0
n 0(None)[if min:
	self.min = min
if max:
	self.max = max
]:
	i: 
	o: 40()

nname: 0
n 0(None)[if min:
	self.min = min
if max:
	self.max = max
delta = abs(self.position - pos) / self.max
if not pos:
	pass
self.position = pos
self._redraw(delta)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb772da8c>}
nname: 179
n 179(None)[]:
	i: 134(AL), 178()
	o: 

nname: 178
n 178(None)[]:
	i: 137(AF), 156()
	o: 179()

nname: 156
n 156(None)[for indicator in self.get_list_obj_by_name(self._indicator_name):
indicator.move(hcenter=computed_pos)
]:
	i: 137(for)
	o: 178()

nname: 137
n 137(None)[]:
	i: 134(loop)
	o: 156(for), 178(AF)

nname: 134
n 134(None)[]:
	i: 18(AL), 133()
	o: 137(loop), 179(AL)

nname: 133
n 133(None)[]:
	i: 92(AF), 111()
	o: 134()

nname: 111
n 111(None)[for bar in self.get_list_obj_by_name(self._bar_name):
bar.resize(width=computed_pos)
]:
	i: 92(for)
	o: 133()

nname: 92
n 92(None)[]:
	i: 18(loop)
	o: 111(for), 133(AF)

nname: 18
n 18(None)[computed_pos = int_to_percent(min(100, (self.position - self.min) * 100.0 / (self.max - self.min)))
log.info('Progressbar redraw (pos: %s, delta: %s)', self.position, delta)
]:
	i: 9(), 17()
	o: 92(loop), 134(AL)

nname: 17
n 17(None)[]:
	i: 0(t)
	o: 18()

nname: 9
n 9(None)[]:
	i: 0(f)
	o: 18()

nname: 0
n 0(self.max)[]:
	i: 
	o: 9(f), 17(t)

nname: 178
n 178(None)[]:
	i: 137()
	o: 

nname: 137
n 137(None)[for indicator in self.get_list_obj_by_name(self._indicator_name):
	indicator.move(hcenter=computed_pos)
]:
	i: 133(loop)
	o: 178()

nname: 133
n 133(None)[]:
	i: 92()
	o: 137(loop)

nname: 92
n 92(None)[for bar in self.get_list_obj_by_name(self._bar_name):
	bar.resize(width=computed_pos)
]:
	i: 0(loop)
	o: 133()

nname: 0
n 0(None)[if not self.max:
	pass
computed_pos = int_to_percent(min(100, (self.position - self.min) * 100.0 / (self.max - self.min)))
log.info('Progressbar redraw (pos: %s, delta: %s)', self.position, delta)
]:
	i: 
	o: 92(loop)

nname: 178
n 178(None)[]:
	i: 133()
	o: 

nname: 133
n 133(None)[for indicator in self.get_list_obj_by_name(self._indicator_name):
	indicator.move(hcenter=computed_pos)
]:
	i: 0()
	o: 178()

nname: 0
n 0(None)[if not self.max:
	pass
computed_pos = int_to_percent(min(100, (self.position - self.min) * 100.0 / (self.max - self.min)))
log.info('Progressbar redraw (pos: %s, delta: %s)', self.position, delta)
for bar in self.get_list_obj_by_name(self._bar_name):
	bar.resize(width=computed_pos)
]:
	i: 
	o: 133()

nname: 178
n 178(None)[]:
	i: 0()
	o: 

nname: 0
n 0(None)[if not self.max:
	pass
computed_pos = int_to_percent(min(100, (self.position - self.min) * 100.0 / (self.max - self.min)))
log.info('Progressbar redraw (pos: %s, delta: %s)', self.position, delta)
for bar in self.get_list_obj_by_name(self._bar_name):
	bar.resize(width=computed_pos)
for indicator in self.get_list_obj_by_name(self._indicator_name):
	indicator.move(hcenter=computed_pos)
]:
	i: 
	o: 178()

nname: 0
n 0(None)[if not self.max:
	pass
computed_pos = int_to_percent(min(100, (self.position - self.min) * 100.0 / (self.max - self.min)))
log.info('Progressbar redraw (pos: %s, delta: %s)', self.position, delta)
for bar in self.get_list_obj_by_name(self._bar_name):
	bar.resize(width=computed_pos)
for indicator in self.get_list_obj_by_name(self._indicator_name):
	indicator.move(hcenter=computed_pos)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb77275ac>}
nname: 6
n 6(None)[def __init__(self):
	wyvas.Container.__init__(self)
	self._bar_name = None
	self._indicator_name = None
	self.min = 0
	self.max = 100
	self.position = 1
	for bar in self.get_list_obj_by_name(self._bar_name):
		bar.resize(width=self.position)
	for indicator in self.get_list_obj_by_name(self._indicator_name):
		indicator.move(hcenter=self.position)
	return None

def update(self, signal, sender, value):
	self.set(**value)

initialize = update
def set_bar(self, bar=None):
	self._bar_name = bar

def set_indicator(self, indicator=None):
	self._indicator_name = indicator

def step(self):
	self.position += 1
	self._redraw(1)

def set(self, pos=None, max=None, min=None):
	if min:
		self.min = min
	if max:
		self.max = max
	delta = abs(self.position - pos) / self.max
	if not pos:
		pass
	self.position = pos
	self._redraw(delta)

def _redraw(self, delta=0):
	if not self.max:
		pass
	computed_pos = int_to_percent(min(100, (self.position - self.min) * 100.0 / (self.max - self.min)))
	log.info('Progressbar redraw (pos: %s, delta: %s)', self.position, delta)
	for bar in self.get_list_obj_by_name(self._bar_name):
		bar.resize(width=computed_pos)
	for indicator in self.get_list_obj_by_name(self._indicator_name):
		indicator.move(hcenter=computed_pos)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb772740c>}
nname: 0
n 0(None)[from __future__ import absolute_import
import wyvas
from peewee.formatters import int_to_percent
from peewee.debug import GET_LOGGER
log = GET_LOGGER(__name__)
class Progressbar(.):
	def __init__(self):
		wyvas.Container.__init__(self)
		self._bar_name = None
		self._indicator_name = None
		self.min = 0
		self.max = 100
		self.position = 1
		for bar in self.get_list_obj_by_name(self._bar_name):
			bar.resize(width=self.position)
		for indicator in self.get_list_obj_by_name(self._indicator_name):
			indicator.move(hcenter=self.position)
		return None

	def update(self, signal, sender, value):
		self.set(**value)

	initialize = update
	def set_bar(self, bar=None):
		self._bar_name = bar

	def set_indicator(self, indicator=None):
		self._indicator_name = indicator

	def step(self):
		self.position += 1
		self._redraw(1)

	def set(self, pos=None, max=None, min=None):
		if min:
			self.min = min
		if max:
			self.max = max
		delta = abs(self.position - pos) / self.max
		if not pos:
			pass
		self.position = pos
		self._redraw(delta)

	def _redraw(self, delta=0):
		if not self.max:
			pass
		computed_pos = int_to_percent(min(100, (self.position - self.min) * 100.0 / (self.max - self.min)))
		log.info('Progressbar redraw (pos: %s, delta: %s)', self.position, delta)
		for bar in self.get_list_obj_by_name(self._bar_name):
			bar.resize(width=computed_pos)
		for indicator in self.get_list_obj_by_name(self._indicator_name):
			indicator.move(hcenter=computed_pos)



]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb772176c>}
from __future__ import absolute_import
import wyvas
from peewee.formatters import int_to_percent
from peewee.debug import GET_LOGGER
log = GET_LOGGER(__name__)
class Progressbar(.):
	def __init__(self):
		wyvas.Container.__init__(self)
		self._bar_name = None
		self._indicator_name = None
		self.min = 0
		self.max = 100
		self.position = 1
		for bar in self.get_list_obj_by_name(self._bar_name):
			bar.resize(width=self.position)
		for indicator in self.get_list_obj_by_name(self._indicator_name):
			indicator.move(hcenter=self.position)
		return None

	def update(self, signal, sender, value):
		self.set(**value)

	initialize = update
	def set_bar(self, bar=None):
		self._bar_name = bar

	def set_indicator(self, indicator=None):
		self._indicator_name = indicator

	def step(self):
		self.position += 1
		self._redraw(1)

	def set(self, pos=None, max=None, min=None):
		if min:
			self.min = min
		if max:
			self.max = max
		delta = abs(self.position - pos) / self.max
		if not pos:
			pass
		self.position = pos
		self._redraw(delta)

	def _redraw(self, delta=0):
		if not self.max:
			pass
		computed_pos = int_to_percent(min(100, (self.position - self.min) * 100.0 / (self.max - self.min)))
		log.info('Progressbar redraw (pos: %s, delta: %s)', self.position, delta)
		for bar in self.get_list_obj_by_name(self._bar_name):
			bar.resize(width=computed_pos)
		for indicator in self.get_list_obj_by_name(self._indicator_name):
			indicator.move(hcenter=computed_pos)



